#include "user.h"
#include <stdio.h>


User::User(int id, std::string username, std::string password, std::string firstname, std::string lastname, time_t joined, bool active) :  m_id(id), m_username(username), m_password(password), m_firstname(firstname), m_lastname(lastname), m_joined(joined), m_active(active)
{}

const int User::getId()
{
    return m_id;
}

void User::setId(const int& id)
{
    m_id = id;
}

const std::string& User::getUsername()
{
    return m_username;
}

void User::setUsername(const std::string& username)
{
    m_username = username;
}

const std::string& User::getPassword()
{
    return m_password;
}

void User::setPassword(const std::string& pass)
{
    m_password = pass;
}

const std::string& User::getFirstName()
{
    return m_firstname;
}

void User::setFirstName(const std::string&firstname)
{
    m_firstname = firstname;
}

const std::string& User::getLastName()
{
    return m_lastname;
}

void User::setLastName(const std::string& lastname)
{
    m_lastname = lastname;
}

const time_t& User::getJoined()
{
    return m_joined;
}

void User::setJoined(const time_t& joined)
{
    m_joined = joined;
}

const bool& User::getActive()
{
    return m_active;
}

void User::setActive(const bool& active)
{
    m_active = active;
}

std::string User::toString()
{
  char s[256];

  sprintf(s, "username %s", m_username.c_str());

  return std::string(s);
}


